package com.imooc.t;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.http.GET;

import java.io.IOException;

public class TestRetrofit {
    public static void main(String[] args) throws IOException {
        Retrofit retrofit = new Retrofit.Builder()
            .baseUrl("http://www.baidu.com")
            .build();

        RetrofitBaiduFeignClient client = retrofit.create(RetrofitBaiduFeignClient.class);
        Call<ResponseBody> index = client.index();
        System.out.println(index.execute().body().string());
    }
}

interface RetrofitBaiduFeignClient {
    @GET("/")
    Call<ResponseBody> index();
}